#include <stdio.h>

int main()
{
	int a = 0;
	int b = 0;
	scanf("%d %d",&a,&b);
	if(!(a>=60&&b>=60)&&!(a<=60&&b<=60))
	 printf("1");
	else
	 printf("0");
	
	return 0;
}
